﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Esint.JudicialAuction.IDAL;
using System.Configuration;
//using Esint.PublicSafety.IDAL;
namespace Esint.JudicialAuction.Factory
{
    public partial class Factory
    {
        private static readonly string profilePath = System.Configuration.ConfigurationManager.AppSettings["profilePath"];
        // private static readonly string DLLName = System.Configuration.ConfigurationSettings.AppSettings["DLLName"];
        /// <summary>
        /// 创建基础数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static IBaseData CreateBaseData()
        {
            string className = profilePath + ".BaseData";
            return (IBaseData)Assembly.Load(profilePath).CreateInstance(className);
        }
        
        /// <summary>
        /// 创建[T_SYS_SQLLOG] 数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static ISys_sqllogData CreateSys_sqllogData()
        {
            string className = profilePath + ".Sys_sqllogData";
            return (ISys_sqllogData)Assembly.Load(profilePath).CreateInstance(className);
        }
        

        public static ICommonData CreateCommonData()
        {
            string className = profilePath + ".CommonData";
            return (ICommonData)Assembly.Load(profilePath).CreateInstance(className);
        }
        
        /// <summary>
        /// 创建[T_Sys_Code] 数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static ISys_CodeData CreateSys_CodeData()
        {
            string className = profilePath + ".Sys_CodeData";
            return (ISys_CodeData)Assembly.Load(profilePath).CreateInstance(className);
        }

        /// <summary>
        /// 创建[T_Sys_CodeMap] 数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static ISys_CodeMapData CreateSys_CodeMapData()
        {
            string className = profilePath + ".Sys_CodeMapData";
            return (ISys_CodeMapData)Assembly.Load(profilePath).CreateInstance(className);
        }

        /// <summary>
        /// 创建[T_Schedule_Shifts] 数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static ISchedule_ShiftsData CreateSchedule_ShiftsData()
        {
            string className = profilePath + ".Schedule_ShiftsData";
            return (ISchedule_ShiftsData)Assembly.Load(profilePath).CreateInstance(className);
        }

        /// <summary>
        /// 创建[T_Schedule_User] 数据表访问对象
        /// </summary>
        /// <returns></returns>
        public static ISchedule_UserData CreateSchedule_UserData()
        {
            string className = profilePath + ".Schedule_UserData";
            return (ISchedule_UserData)Assembly.Load(profilePath).CreateInstance(className);
        }

    }
}
